<?
$total = $this->total;
$ads = $this->ads;
$dateFormat = 'Y-m-d';
?>

<div class="content-box">

    <div class="content-box-header">
        <h3>Currenty promoted.</h3>
        <ul class="content-box-tabs">
            <li><a class="default-tab" href="#tab1">Table</a></li>
        </ul>
        <div class="clear"></div>
    </div>
    <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
            Total: <?= $total ?>.
            <table class="table table-striped">
                <thead>
                <tr>
                    <th>#</th>
                    <th>Автор</th>
                    <th>Рубрика</th>
                    <th>Повышен рейтнг до</th>
                </tr>
                </thead>
                <tbody>
                <? foreach ($ads as $ad): ?>
                <tr>
                    <td><?= $ad['id'] ?></td>
                    <td><?= $this->escape($ad['author']); ?></td>
                    <td>
                        <a href="/ad/view/id/<?= $ad['subCat']['id'] ?>">
                            <?= $this->escape($ad['subCat']['name']); ?>
                            [ <?= $this->escape($ad['subCat']['category']['name']); ?>]
                        </a>
                    </td>
                    <td><?= $ad['promotedDate']->format($dateFormat) ?></td>
                </tr>
                    <? endforeach; ?>
                </tbody>
            </table>
        </div>
    </div>
</div>